package org.huangrui.design.pattern.decorate;

public class TestProducts {
    public static void main(String[] args) {//测试类
        Product milkyTea = new MilkyTea();
        System.out.println("普通奶茶价格：" + milkyTea.totalPrice());
        System.out.println("普通奶茶材料：" + milkyTea.showMaterials());

        System.out.println("==================");
        Product pearl = new Pearl(new MilkyTea());
        System.out.println("珍珠奶茶价格：" + pearl.totalPrice());
        System.out.println("珍珠奶茶材料：" + pearl.showMaterials());

        System.out.println("==================");
        Product nataDeCoco = new NataDeCoco(new MilkyTea());
        System.out.println("椰果奶茶价格：" + nataDeCoco.totalPrice());
        System.out.println("椰果奶茶材料：" + nataDeCoco.showMaterials());

        System.out.println("===============");
        Product nataDeCocoPearl = new NataDeCoco(new Pearl(new MilkyTea()));
        System.out.println("椰果珍珠奶茶价格：" + nataDeCocoPearl.totalPrice());
        System.out.println("椰果珍珠奶茶材料：" + nataDeCocoPearl.showMaterials());

        System.out.println("===============");
        Product nataDeCoco2Pearl = new NataDeCoco(new Pearl(new NataDeCoco(new MilkyTea())));
        System.out.println("椰果双倍珍珠奶茶价格：" + nataDeCoco2Pearl.totalPrice());
        System.out.println("椰果双倍珍珠奶茶材料：" + nataDeCoco2Pearl.showMaterials());

        System.out.println("===============");
        Product all = new NataDeCoco(new Pearl(new TaroBall(new MilkyTea())));
        System.out.println("椰果珍珠芋圆奶茶价格：" + all.totalPrice());
        System.out.println("椰果珍珠芋圆奶茶材料：" + all.showMaterials());
    }
}
